<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>动画奔跑熊</title>
    <style>
      @keyframes bearRunning {
        from {
          background-position: 0;
        }
        to {
          background-position: -1600px 0;
        }
      }

      body {
        background-color: #ccc;
      }

      .bear {
        width: 200px;
        height: 100px;
        background: url(../img/bear.png) no-repeat;
        margin: 300px auto;
        /* steps(n)表示动画播放时分的步长 */
        animation: bearRunning 1s steps(8) infinite;
      }
    </style>
  </head>
  <body>
    <div class="bear"></div>
  </body>
</html>
